<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>JSON - JSON (JavaScript Object Notation) encoder/decoder - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of JSON - MetaCPAN" href="https://metacpan.org/dist/JSON/releases.rss" />
        <link rel="canonical" href="JSON.html" />
        <meta name="description" content="JSON (JavaScript Object Notation) encoder/decoder" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/JSON" />
<meta name="twitter:title"       content="JSON" />
<meta name="twitter:description" content="JSON (JavaScript Object Notation) encoder/decoder" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="JSON.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of JSON was released.">
      <span class="relatize">09 Oct 2022 00:11:31 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/JSON">JSON</a>
  </li>
  <li>
    Module version: 4.10
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/JSON/source/lib/JSON.pm">Source</a>
    (<a href="https://metacpan.org/dist/JSON/source/lib/JSON.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/JSON/source/lib">Browse</a>
    (<a href="https://metacpan.org/dist/JSON/source/lib?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/JSON/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/JSON/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/makamaka/JSON">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://github.com/makamaka/JSON/issues">Issues</a>
      (7)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=JSON+4.10" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/J/JSON.html?oncpan=1&amp;distmat=1&amp;version=4.10&amp;grade=2" style="color: #090">4011</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/J/JSON.html?oncpan=1&amp;distmat=1&amp;version=4.10&amp;grade=3" style="color: #900">1</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/J/JSON.html?oncpan=1&amp;distmat=1&amp;version=4.10&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/ISHIGAKI/JSON-4.10">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on JSON who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/JSON-4.10/index.html">78.76% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/JSON/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.10.tar.gz">
      Download (<span itemprop="fileSize">92.13KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FISHIGAKI%2FJSON-4.10%2Flib%2FJSON.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/JSON/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/JSON/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:JSON">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="JSON">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/JSON.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="ISHIGAKI/JSON-4.10"
>4.10
  (ISHIGAKI on 2022-10-09)</option>
<option
  
  value="ISHIGAKI/JSON-4.09"
>4.09
  (ISHIGAKI on 2022-08-01)</option>
<option
  
  value="ISHIGAKI/JSON-4.08"
>4.08
  (ISHIGAKI on 2022-07-31)</option>
<option
  
  value="ISHIGAKI/JSON-4.07"
>4.07
  (ISHIGAKI on 2022-06-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.06"
>4.06
  (ISHIGAKI on 2022-05-22)</option>
<option
  
  value="ISHIGAKI/JSON-4.05"
>4.05
  (ISHIGAKI on 2022-01-14)</option>
<option
  
  value="ISHIGAKI/JSON-4.04"
>4.04
  (ISHIGAKI on 2021-12-17)</option>
<option
  
  value="ISHIGAKI/JSON-4.03"
>4.03
  (ISHIGAKI on 2021-01-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.02"
>4.02
  (ISHIGAKI on 2019-02-23)</option>
<option
  
  value="ISHIGAKI/JSON-4.01"
>4.01
  (ISHIGAKI on 2019-01-20)</option>
<option
  
  value="ISHIGAKI/JSON-4.00"
>4.00
  (ISHIGAKI on 2018-12-06)</option>
<option
  
  value="ISHIGAKI/JSON-3.99_01"
>3.99_01 DEV
  (ISHIGAKI on 2018-12-03)</option>
<option
  
  value="ISHIGAKI/JSON-2.97001"
>2.97001
  (ISHIGAKI on 2017-12-21)</option>
<option
  
  value="ISHIGAKI/JSON-2.97000"
>2.97000
  (ISHIGAKI on 2017-11-20)</option>
<option
  
  value="ISHIGAKI/JSON-2.96"
>2.96
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.95"
>2.95
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.94"
>2.94
  (ISHIGAKI on 2017-05-29)</option>
<option
  
  value="ISHIGAKI/JSON-2.92"
>2.92
  (ISHIGAKI on 2017-05-15)</option>
<option
  
  value="MAKAMAKA/JSON-2.90"
>2.90
  (MAKAMAKA on 2013-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.61"
>2.61
  (MAKAMAKA on 2013-10-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.59"
>2.59
  (MAKAMAKA on 2013-06-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.58"
>2.58
  (MAKAMAKA on 2013-05-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.57"
>2.57
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.53"
>2.53
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.52"
>2.52
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.51"
>2.51
  (MAKAMAKA on 2011-03-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.50"
>2.50
  (MAKAMAKA on 2010-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.49_01"
>2.49_01 DEV
  (MAKAMAKA on 2010-11-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.27"
>2.27
  (MAKAMAKA on 2010-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.26"
>2.26
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.25"
>2.25
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.24"
>2.24
  (MAKAMAKA on 2010-09-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.23"
>2.23
  (MAKAMAKA on 2010-09-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.15"
>1.15
  (MAKAMAKA on 2007-11-14)</option>
<option
  
  value="MAKAMAKA/JSON-1.14"
>1.14
  (MAKAMAKA on 2007-05-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.13"
>1.13
  (MAKAMAKA on 2007-05-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ISHIGAKI/JSON-2.93"
>2.93
  (ISHIGAKI on 2017-05-18)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_04"
>2.91_04 DEV
  (ISHIGAKI on 2017-01-10)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_03"
>2.91_03 DEV
  (ISHIGAKI on 2017-01-09)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_02"
>2.91_02 DEV
  (ISHIGAKI on 2016-12-04)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_01"
>2.91_01 DEV
  (ISHIGAKI on 2016-12-03)</option>
<option
  
  value="MAKAMAKA/JSON-2.56"
>2.56
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.55"
>2.55
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.54"
>2.54
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.22"
>2.22
  (MAKAMAKA on 2010-08-25)</option>
<option
  
  value="MAKAMAKA/JSON-2.21_001"
>2.21_001 DEV
  (MAKAMAKA on 2010-08-19)</option>
<option
  
  value="MAKAMAKA/JSON-2.21"
>2.21
  (MAKAMAKA on 2010-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.20"
>2.20
  (MAKAMAKA on 2010-04-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.19"
>2.19
  (MAKAMAKA on 2010-03-30)</option>
<option
  
  value="MAKAMAKA/JSON-2.18"
>2.18
  (MAKAMAKA on 2010-03-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.17"
>2.17
  (MAKAMAKA on 2010-01-07)</option>
<option
  
  value="MAKAMAKA/JSON-2.16"
>2.16
  (MAKAMAKA on 2009-10-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.15"
>2.15
  (MAKAMAKA on 2009-06-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.14"
>2.14
  (MAKAMAKA on 2009-02-24)</option>
<option
  
  value="MAKAMAKA/JSON-2.13"
>2.13
  (MAKAMAKA on 2009-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-2.12"
>2.12
  (MAKAMAKA on 2008-07-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.11"
>2.11
  (MAKAMAKA on 2008-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.10"
>2.10
  (MAKAMAKA on 2008-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.09"
>2.09
  (MAKAMAKA on 2008-04-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.08"
>2.08
  (MAKAMAKA on 2008-04-12)</option>
<option
  
  value="MAKAMAKA/JSON-2.07"
>2.07
  (MAKAMAKA on 2008-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.06"
>2.06
  (MAKAMAKA on 2008-02-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.05"
>2.05
  (MAKAMAKA on 2008-02-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.04"
>2.04
  (MAKAMAKA on 2008-01-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.03"
>2.03
  (MAKAMAKA on 2008-01-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.02"
>2.02
  (MAKAMAKA on 2007-12-26)</option>
<option
  
  value="MAKAMAKA/JSON-2.01"
>2.01
  (MAKAMAKA on 2007-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.00"
>2.00
  (MAKAMAKA on 2007-12-19)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_05"
>1.99_05 DEV
  (MAKAMAKA on 2007-12-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_04"
>1.99_04 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_03"
>1.99_03 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_02"
>1.99_02 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_01"
>1.99_01 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.12"
>1.12
  (MAKAMAKA on 2007-05-03)</option>
<option
  
  value="MAKAMAKA/JSON-1.11"
>1.11
  (MAKAMAKA on 2007-04-23)</option>
<option
  
  value="MAKAMAKA/JSON-1.10"
>1.10
  (MAKAMAKA on 2007-04-18)</option>
<option
  
  value="MAKAMAKA/JSON-1.09"
>1.09
  (MAKAMAKA on 2007-03-27)</option>
<option
  
  value="MAKAMAKA/JSON-1.08"
>1.08
  (MAKAMAKA on 2007-03-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.07"
>1.07
  (MAKAMAKA on 2006-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-1.05"
>1.05
  (MAKAMAKA on 2006-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.04"
>1.04
  (MAKAMAKA on 2006-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.03"
>1.03
  (MAKAMAKA on 2005-12-29)</option>
<option
  
  value="MAKAMAKA/JSON-1.02"
>1.02
  (MAKAMAKA on 2005-11-24)</option>
<option
  
  value="MAKAMAKA/JSON-1.01"
>1.01
  (MAKAMAKA on 2005-11-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.00"
>1.00
  (MAKAMAKA on 2005-09-29)</option>
<option
  
  value="MAKAMAKA/JSON-0.991"
>0.991
  (MAKAMAKA on 2005-09-02)</option>
<option
  
  value="MAKAMAKA/JSON-0.99"
>0.99
  (MAKAMAKA on 2005-07-23)</option>
<option
  
  value="MAKAMAKA/JSON-0.981"
>0.981
  (MAKAMAKA on 2005-07-19)</option>
<option
  
  value="MAKAMAKA/JSON-0.98"
>0.98
  (MAKAMAKA on 2005-07-18)</option>
<option
  
  value="MAKAMAKA/JSON-0.97"
>0.97
  (MAKAMAKA on 2005-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-0.96"
>0.96
  (MAKAMAKA on 2005-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-0.92"
>0.92
  (MAKAMAKA on 2005-05-11)</option>
<option
  
  value="MAKAMAKA/JSON-0.91"
>0.91
  (MAKAMAKA on 2005-04-13)</option>
<option
  
  value="MAKAMAKA/JSON-0.9"
>0.9
  (MAKAMAKA on 2005-04-12)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/ISHIGAKI/JSON-4.10/diff/' + encodeURIComponent(this.value) + '/lib/JSON.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="ISHIGAKI/JSON-4.10"
>4.10
  (ISHIGAKI on 2022-10-09)</option>
<option
  
  value="ISHIGAKI/JSON-4.09"
>4.09
  (ISHIGAKI on 2022-08-01)</option>
<option
  
  value="ISHIGAKI/JSON-4.08"
>4.08
  (ISHIGAKI on 2022-07-31)</option>
<option
  
  value="ISHIGAKI/JSON-4.07"
>4.07
  (ISHIGAKI on 2022-06-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.06"
>4.06
  (ISHIGAKI on 2022-05-22)</option>
<option
  
  value="ISHIGAKI/JSON-4.05"
>4.05
  (ISHIGAKI on 2022-01-14)</option>
<option
  
  value="ISHIGAKI/JSON-4.04"
>4.04
  (ISHIGAKI on 2021-12-17)</option>
<option
  
  value="ISHIGAKI/JSON-4.03"
>4.03
  (ISHIGAKI on 2021-01-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.02"
>4.02
  (ISHIGAKI on 2019-02-23)</option>
<option
  
  value="ISHIGAKI/JSON-4.01"
>4.01
  (ISHIGAKI on 2019-01-20)</option>
<option
  
  value="ISHIGAKI/JSON-4.00"
>4.00
  (ISHIGAKI on 2018-12-06)</option>
<option
  
  value="ISHIGAKI/JSON-3.99_01"
>3.99_01 DEV
  (ISHIGAKI on 2018-12-03)</option>
<option
  
  value="ISHIGAKI/JSON-2.97001"
>2.97001
  (ISHIGAKI on 2017-12-21)</option>
<option
  
  value="ISHIGAKI/JSON-2.97000"
>2.97000
  (ISHIGAKI on 2017-11-20)</option>
<option
  
  value="ISHIGAKI/JSON-2.96"
>2.96
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.95"
>2.95
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.94"
>2.94
  (ISHIGAKI on 2017-05-29)</option>
<option
  
  value="ISHIGAKI/JSON-2.92"
>2.92
  (ISHIGAKI on 2017-05-15)</option>
<option
  
  value="MAKAMAKA/JSON-2.90"
>2.90
  (MAKAMAKA on 2013-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.61"
>2.61
  (MAKAMAKA on 2013-10-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.59"
>2.59
  (MAKAMAKA on 2013-06-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.58"
>2.58
  (MAKAMAKA on 2013-05-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.57"
>2.57
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.53"
>2.53
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.52"
>2.52
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.51"
>2.51
  (MAKAMAKA on 2011-03-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.50"
>2.50
  (MAKAMAKA on 2010-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.49_01"
>2.49_01 DEV
  (MAKAMAKA on 2010-11-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.27"
>2.27
  (MAKAMAKA on 2010-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.26"
>2.26
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.25"
>2.25
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.24"
>2.24
  (MAKAMAKA on 2010-09-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.23"
>2.23
  (MAKAMAKA on 2010-09-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.15"
>1.15
  (MAKAMAKA on 2007-11-14)</option>
<option
  
  value="MAKAMAKA/JSON-1.14"
>1.14
  (MAKAMAKA on 2007-05-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.13"
>1.13
  (MAKAMAKA on 2007-05-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ISHIGAKI/JSON-2.93"
>2.93
  (ISHIGAKI on 2017-05-18)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_04"
>2.91_04 DEV
  (ISHIGAKI on 2017-01-10)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_03"
>2.91_03 DEV
  (ISHIGAKI on 2017-01-09)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_02"
>2.91_02 DEV
  (ISHIGAKI on 2016-12-04)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_01"
>2.91_01 DEV
  (ISHIGAKI on 2016-12-03)</option>
<option
  
  value="MAKAMAKA/JSON-2.56"
>2.56
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.55"
>2.55
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.54"
>2.54
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.22"
>2.22
  (MAKAMAKA on 2010-08-25)</option>
<option
  
  value="MAKAMAKA/JSON-2.21_001"
>2.21_001 DEV
  (MAKAMAKA on 2010-08-19)</option>
<option
  
  value="MAKAMAKA/JSON-2.21"
>2.21
  (MAKAMAKA on 2010-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.20"
>2.20
  (MAKAMAKA on 2010-04-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.19"
>2.19
  (MAKAMAKA on 2010-03-30)</option>
<option
  
  value="MAKAMAKA/JSON-2.18"
>2.18
  (MAKAMAKA on 2010-03-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.17"
>2.17
  (MAKAMAKA on 2010-01-07)</option>
<option
  
  value="MAKAMAKA/JSON-2.16"
>2.16
  (MAKAMAKA on 2009-10-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.15"
>2.15
  (MAKAMAKA on 2009-06-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.14"
>2.14
  (MAKAMAKA on 2009-02-24)</option>
<option
  
  value="MAKAMAKA/JSON-2.13"
>2.13
  (MAKAMAKA on 2009-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-2.12"
>2.12
  (MAKAMAKA on 2008-07-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.11"
>2.11
  (MAKAMAKA on 2008-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.10"
>2.10
  (MAKAMAKA on 2008-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.09"
>2.09
  (MAKAMAKA on 2008-04-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.08"
>2.08
  (MAKAMAKA on 2008-04-12)</option>
<option
  
  value="MAKAMAKA/JSON-2.07"
>2.07
  (MAKAMAKA on 2008-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.06"
>2.06
  (MAKAMAKA on 2008-02-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.05"
>2.05
  (MAKAMAKA on 2008-02-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.04"
>2.04
  (MAKAMAKA on 2008-01-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.03"
>2.03
  (MAKAMAKA on 2008-01-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.02"
>2.02
  (MAKAMAKA on 2007-12-26)</option>
<option
  
  value="MAKAMAKA/JSON-2.01"
>2.01
  (MAKAMAKA on 2007-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.00"
>2.00
  (MAKAMAKA on 2007-12-19)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_05"
>1.99_05 DEV
  (MAKAMAKA on 2007-12-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_04"
>1.99_04 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_03"
>1.99_03 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_02"
>1.99_02 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_01"
>1.99_01 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.12"
>1.12
  (MAKAMAKA on 2007-05-03)</option>
<option
  
  value="MAKAMAKA/JSON-1.11"
>1.11
  (MAKAMAKA on 2007-04-23)</option>
<option
  
  value="MAKAMAKA/JSON-1.10"
>1.10
  (MAKAMAKA on 2007-04-18)</option>
<option
  
  value="MAKAMAKA/JSON-1.09"
>1.09
  (MAKAMAKA on 2007-03-27)</option>
<option
  
  value="MAKAMAKA/JSON-1.08"
>1.08
  (MAKAMAKA on 2007-03-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.07"
>1.07
  (MAKAMAKA on 2006-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-1.05"
>1.05
  (MAKAMAKA on 2006-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.04"
>1.04
  (MAKAMAKA on 2006-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.03"
>1.03
  (MAKAMAKA on 2005-12-29)</option>
<option
  
  value="MAKAMAKA/JSON-1.02"
>1.02
  (MAKAMAKA on 2005-11-24)</option>
<option
  
  value="MAKAMAKA/JSON-1.01"
>1.01
  (MAKAMAKA on 2005-11-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.00"
>1.00
  (MAKAMAKA on 2005-09-29)</option>
<option
  
  value="MAKAMAKA/JSON-0.991"
>0.991
  (MAKAMAKA on 2005-09-02)</option>
<option
  
  value="MAKAMAKA/JSON-0.99"
>0.99
  (MAKAMAKA on 2005-07-23)</option>
<option
  
  value="MAKAMAKA/JSON-0.981"
>0.981
  (MAKAMAKA on 2005-07-19)</option>
<option
  
  value="MAKAMAKA/JSON-0.98"
>0.98
  (MAKAMAKA on 2005-07-18)</option>
<option
  
  value="MAKAMAKA/JSON-0.97"
>0.97
  (MAKAMAKA on 2005-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-0.96"
>0.96
  (MAKAMAKA on 2005-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-0.92"
>0.92
  (MAKAMAKA on 2005-05-11)</option>
<option
  
  value="MAKAMAKA/JSON-0.91"
>0.91
  (MAKAMAKA on 2005-04-13)</option>
<option
  
  value="MAKAMAKA/JSON-0.9"
>0.9
  (MAKAMAKA on 2005-04-12)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Test::More" title="Test::More" class="ellipsis">Test::More</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/JSON/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=JSON">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=JSON">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/ISHIGAKI/JSON-4.10/view/lib/JSON.pm">This version</a>
    </li>
    <li>
      <a href="JSON.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/KOORCHIK"><img src="https://www.gravatar.com/avatar/388f0564e6cb0de0996b4f0d3c50e9f8?d=identicon&amp;s=20" title="KOORCHIK" alt="KOORCHIK"></a>
<a class="display-all" href="https://metacpan.org/author/DAGOLDEN"><img src="https://www.gravatar.com/avatar/bb755c989fcb9897f28a2c6e00df61e2?d=identicon&amp;s=20" title="DAGOLDEN" alt="DAGOLDEN"></a>
<a class="display-all" href="https://metacpan.org/author/TOKUHIROM"><img src="https://www.gravatar.com/avatar/70f90c6a0bcd84348b02309babc98684?d=identicon&amp;s=20" title="TOKUHIROM" alt="TOKUHIROM"></a>
<a class="display-all" href="https://metacpan.org/author/JONASBN"><img src="https://www.gravatar.com/avatar/1b053b414cecd279ef44423c75b3d227?d=identicon&amp;s=20" title="JONASBN" alt="JONASBN"></a>
<a class="display-all" href="https://metacpan.org/author/PWBENNETT"><img src="https://www.gravatar.com/avatar/41a085cce4a7061cf4ee49d02b9bed0e?d=identicon&amp;s=20" title="PWBENNETT" alt="PWBENNETT"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/JSON/plussers">46 PAUSE users</a>
</div>
<div>
    59 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
    >
      Makamaka Hannyaharamitu, E&lt;lt&gt;makamaka[at]cpan.orgE&lt;gt&gt;
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/ISHIGAKI" class="author-name">Kenichi Ishigaki</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/JSON.pm&#39;" class="">
<option
  selected
  value="ISHIGAKI/JSON-4.10"
>4.10
  (ISHIGAKI on 2022-10-09)</option>
<option
  
  value="ISHIGAKI/JSON-4.09"
>4.09
  (ISHIGAKI on 2022-08-01)</option>
<option
  
  value="ISHIGAKI/JSON-4.08"
>4.08
  (ISHIGAKI on 2022-07-31)</option>
<option
  
  value="ISHIGAKI/JSON-4.07"
>4.07
  (ISHIGAKI on 2022-06-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.06"
>4.06
  (ISHIGAKI on 2022-05-22)</option>
<option
  
  value="ISHIGAKI/JSON-4.05"
>4.05
  (ISHIGAKI on 2022-01-14)</option>
<option
  
  value="ISHIGAKI/JSON-4.04"
>4.04
  (ISHIGAKI on 2021-12-17)</option>
<option
  
  value="ISHIGAKI/JSON-4.03"
>4.03
  (ISHIGAKI on 2021-01-24)</option>
<option
  
  value="ISHIGAKI/JSON-4.02"
>4.02
  (ISHIGAKI on 2019-02-23)</option>
<option
  
  value="ISHIGAKI/JSON-4.01"
>4.01
  (ISHIGAKI on 2019-01-20)</option>
<option
  
  value="ISHIGAKI/JSON-4.00"
>4.00
  (ISHIGAKI on 2018-12-06)</option>
<option
  
  value="ISHIGAKI/JSON-3.99_01"
>3.99_01 DEV
  (ISHIGAKI on 2018-12-03)</option>
<option
  
  value="ISHIGAKI/JSON-2.97001"
>2.97001
  (ISHIGAKI on 2017-12-21)</option>
<option
  
  value="ISHIGAKI/JSON-2.97000"
>2.97000
  (ISHIGAKI on 2017-11-20)</option>
<option
  
  value="ISHIGAKI/JSON-2.96"
>2.96
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.95"
>2.95
  (ISHIGAKI on 2017-11-19)</option>
<option
  
  value="ISHIGAKI/JSON-2.94"
>2.94
  (ISHIGAKI on 2017-05-29)</option>
<option
  
  value="ISHIGAKI/JSON-2.92"
>2.92
  (ISHIGAKI on 2017-05-15)</option>
<option
  
  value="MAKAMAKA/JSON-2.90"
>2.90
  (MAKAMAKA on 2013-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.61"
>2.61
  (MAKAMAKA on 2013-10-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.59"
>2.59
  (MAKAMAKA on 2013-06-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.58"
>2.58
  (MAKAMAKA on 2013-05-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.57"
>2.57
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.53"
>2.53
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.52"
>2.52
  (MAKAMAKA on 2011-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-2.51"
>2.51
  (MAKAMAKA on 2011-03-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.50"
>2.50
  (MAKAMAKA on 2010-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.49_01"
>2.49_01 DEV
  (MAKAMAKA on 2010-11-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.27"
>2.27
  (MAKAMAKA on 2010-10-31)</option>
<option
  
  value="MAKAMAKA/JSON-2.26"
>2.26
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.25"
>2.25
  (MAKAMAKA on 2010-09-28)</option>
<option
  
  value="MAKAMAKA/JSON-2.24"
>2.24
  (MAKAMAKA on 2010-09-27)</option>
<option
  
  value="MAKAMAKA/JSON-2.23"
>2.23
  (MAKAMAKA on 2010-09-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.15"
>1.15
  (MAKAMAKA on 2007-11-14)</option>
<option
  
  value="MAKAMAKA/JSON-1.14"
>1.14
  (MAKAMAKA on 2007-05-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.13"
>1.13
  (MAKAMAKA on 2007-05-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ISHIGAKI/JSON-2.93"
>2.93
  (ISHIGAKI on 2017-05-18)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_04"
>2.91_04 DEV
  (ISHIGAKI on 2017-01-10)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_03"
>2.91_03 DEV
  (ISHIGAKI on 2017-01-09)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_02"
>2.91_02 DEV
  (ISHIGAKI on 2016-12-04)</option>
<option
  
  value="ISHIGAKI/JSON-2.91_01"
>2.91_01 DEV
  (ISHIGAKI on 2016-12-03)</option>
<option
  
  value="MAKAMAKA/JSON-2.56"
>2.56
  (MAKAMAKA on 2013-04-06)</option>
<option
  
  value="MAKAMAKA/JSON-2.55"
>2.55
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.54"
>2.54
  (MAKAMAKA on 2013-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.22"
>2.22
  (MAKAMAKA on 2010-08-25)</option>
<option
  
  value="MAKAMAKA/JSON-2.21_001"
>2.21_001 DEV
  (MAKAMAKA on 2010-08-19)</option>
<option
  
  value="MAKAMAKA/JSON-2.21"
>2.21
  (MAKAMAKA on 2010-04-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.20"
>2.20
  (MAKAMAKA on 2010-04-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.19"
>2.19
  (MAKAMAKA on 2010-03-30)</option>
<option
  
  value="MAKAMAKA/JSON-2.18"
>2.18
  (MAKAMAKA on 2010-03-23)</option>
<option
  
  value="MAKAMAKA/JSON-2.17"
>2.17
  (MAKAMAKA on 2010-01-07)</option>
<option
  
  value="MAKAMAKA/JSON-2.16"
>2.16
  (MAKAMAKA on 2009-10-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.15"
>2.15
  (MAKAMAKA on 2009-06-02)</option>
<option
  
  value="MAKAMAKA/JSON-2.14"
>2.14
  (MAKAMAKA on 2009-02-24)</option>
<option
  
  value="MAKAMAKA/JSON-2.13"
>2.13
  (MAKAMAKA on 2009-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-2.12"
>2.12
  (MAKAMAKA on 2008-07-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.11"
>2.11
  (MAKAMAKA on 2008-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-2.10"
>2.10
  (MAKAMAKA on 2008-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.09"
>2.09
  (MAKAMAKA on 2008-04-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.08"
>2.08
  (MAKAMAKA on 2008-04-12)</option>
<option
  
  value="MAKAMAKA/JSON-2.07"
>2.07
  (MAKAMAKA on 2008-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-2.06"
>2.06
  (MAKAMAKA on 2008-02-08)</option>
<option
  
  value="MAKAMAKA/JSON-2.05"
>2.05
  (MAKAMAKA on 2008-02-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.04"
>2.04
  (MAKAMAKA on 2008-01-05)</option>
<option
  
  value="MAKAMAKA/JSON-2.03"
>2.03
  (MAKAMAKA on 2008-01-04)</option>
<option
  
  value="MAKAMAKA/JSON-2.02"
>2.02
  (MAKAMAKA on 2007-12-26)</option>
<option
  
  value="MAKAMAKA/JSON-2.01"
>2.01
  (MAKAMAKA on 2007-12-20)</option>
<option
  
  value="MAKAMAKA/JSON-2.00"
>2.00
  (MAKAMAKA on 2007-12-19)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_05"
>1.99_05 DEV
  (MAKAMAKA on 2007-12-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_04"
>1.99_04 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_03"
>1.99_03 DEV
  (MAKAMAKA on 2007-12-10)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_02"
>1.99_02 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.99_01"
>1.99_01 DEV
  (MAKAMAKA on 2007-12-08)</option>
<option
  
  value="MAKAMAKA/JSON-1.12"
>1.12
  (MAKAMAKA on 2007-05-03)</option>
<option
  
  value="MAKAMAKA/JSON-1.11"
>1.11
  (MAKAMAKA on 2007-04-23)</option>
<option
  
  value="MAKAMAKA/JSON-1.10"
>1.10
  (MAKAMAKA on 2007-04-18)</option>
<option
  
  value="MAKAMAKA/JSON-1.09"
>1.09
  (MAKAMAKA on 2007-03-27)</option>
<option
  
  value="MAKAMAKA/JSON-1.08"
>1.08
  (MAKAMAKA on 2007-03-26)</option>
<option
  
  value="MAKAMAKA/JSON-1.07"
>1.07
  (MAKAMAKA on 2006-06-04)</option>
<option
  
  value="MAKAMAKA/JSON-1.05"
>1.05
  (MAKAMAKA on 2006-02-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.04"
>1.04
  (MAKAMAKA on 2006-02-16)</option>
<option
  
  value="MAKAMAKA/JSON-1.03"
>1.03
  (MAKAMAKA on 2005-12-29)</option>
<option
  
  value="MAKAMAKA/JSON-1.02"
>1.02
  (MAKAMAKA on 2005-11-24)</option>
<option
  
  value="MAKAMAKA/JSON-1.01"
>1.01
  (MAKAMAKA on 2005-11-21)</option>
<option
  
  value="MAKAMAKA/JSON-1.00"
>1.00
  (MAKAMAKA on 2005-09-29)</option>
<option
  
  value="MAKAMAKA/JSON-0.991"
>0.991
  (MAKAMAKA on 2005-09-02)</option>
<option
  
  value="MAKAMAKA/JSON-0.99"
>0.99
  (MAKAMAKA on 2005-07-23)</option>
<option
  
  value="MAKAMAKA/JSON-0.981"
>0.981
  (MAKAMAKA on 2005-07-19)</option>
<option
  
  value="MAKAMAKA/JSON-0.98"
>0.98
  (MAKAMAKA on 2005-07-18)</option>
<option
  
  value="MAKAMAKA/JSON-0.97"
>0.97
  (MAKAMAKA on 2005-06-17)</option>
<option
  
  value="MAKAMAKA/JSON-0.96"
>0.96
  (MAKAMAKA on 2005-05-22)</option>
<option
  
  value="MAKAMAKA/JSON-0.92"
>0.92
  (MAKAMAKA on 2005-05-11)</option>
<option
  
  value="MAKAMAKA/JSON-0.91"
>0.91
  (MAKAMAKA on 2005-04-13)</option>
<option
  
  value="MAKAMAKA/JSON-0.9"
>0.9
  (MAKAMAKA on 2005-04-12)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/JSON">JSON-4.10</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 1544 direct dependents &#10;          • 3401 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="JSON-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="JSON-4.10">
    <input type="hidden" name="author" value="ISHIGAKI">
    <input type="hidden" name="distribution" value="JSON">
    <button type="submit" class="favorite highlight"><span>105</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="JSON.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>105</span> ++</a>
</div>
   / <span>JSON</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="JSON.html#NAME">NAME</a></li>
  <li><a href="JSON.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="JSON.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="JSON.html#CHOOSING-BACKEND">CHOOSING BACKEND</a></li>
  <li><a href="JSON.html#USING-OPTIONAL-FEATURES">USING OPTIONAL FEATURES</a></li>
  <li><a href="JSON.html#FUNCTIONAL-INTERFACE">FUNCTIONAL INTERFACE</a>
    <ul>
      <li><a href="JSON.html#encode_json">encode_json</a></li>
      <li><a href="JSON.html#decode_json">decode_json</a></li>
      <li><a href="JSON.html#to_json">to_json</a></li>
      <li><a href="JSON.html#from_json">from_json</a></li>
      <li><a href="JSON.html#JSON::is_bool">JSON::is_bool</a></li>
    </ul>
  </li>
  <li><a href="JSON.html#COMMON-OBJECT-ORIENTED-INTERFACE">COMMON OBJECT-ORIENTED INTERFACE</a>
    <ul>
      <li><a href="JSON.html#new">new</a></li>
      <li><a href="JSON.html#ascii">ascii</a></li>
      <li><a href="JSON.html#latin1">latin1</a></li>
      <li><a href="JSON.html#utf8">utf8</a></li>
      <li><a href="JSON.html#pretty">pretty</a></li>
      <li><a href="JSON.html#indent">indent</a></li>
      <li><a href="JSON.html#space_before">space_before</a></li>
      <li><a href="JSON.html#space_after">space_after</a></li>
      <li><a href="JSON.html#relaxed">relaxed</a></li>
      <li><a href="JSON.html#canonical">canonical</a></li>
      <li><a href="JSON.html#allow_nonref">allow_nonref</a></li>
      <li><a href="JSON.html#allow_unknown">allow_unknown</a></li>
      <li><a href="JSON.html#allow_blessed">allow_blessed</a></li>
      <li><a href="JSON.html#convert_blessed">convert_blessed</a></li>
      <li><a href="JSON.html#allow_tags-(since-version-3.0)">allow_tags (since version 3.0)</a></li>
      <li><a href="JSON.html#boolean_values-(since-version-4.0)">boolean_values (since version 4.0)</a></li>
      <li><a href="JSON.html#filter_json_object">filter_json_object</a></li>
      <li><a href="JSON.html#filter_json_single_key_object">filter_json_single_key_object</a></li>
      <li><a href="JSON.html#max_depth">max_depth</a></li>
      <li><a href="JSON.html#max_size">max_size</a></li>
      <li><a href="JSON.html#encode">encode</a></li>
      <li><a href="JSON.html#decode">decode</a></li>
      <li><a href="JSON.html#decode_prefix">decode_prefix</a></li>
    </ul>
  </li>
  <li><a href="JSON.html#ADDITIONAL-METHODS">ADDITIONAL METHODS</a>
    <ul>
      <li><a href="JSON.html#backend">backend</a></li>
      <li><a href="JSON.html#is_xs">is_xs</a></li>
      <li><a href="JSON.html#is_pp">is_pp</a></li>
      <li><a href="JSON.html#property">property</a></li>
      <li><a href="JSON.html#boolean">boolean</a></li>
    </ul>
  </li>
  <li><a href="JSON.html#INCREMENTAL-PARSING">INCREMENTAL PARSING</a>
    <ul>
      <li><a href="JSON.html#incr_parse">incr_parse</a></li>
      <li><a href="JSON.html#incr_text">incr_text</a></li>
      <li><a href="JSON.html#incr_skip">incr_skip</a></li>
      <li><a href="JSON.html#incr_reset">incr_reset</a></li>
    </ul>
  </li>
  <li><a href="JSON.html#MAPPING">MAPPING</a>
    <ul>
      <li><a href="JSON.html#JSON-%3E-PERL">JSON -&gt; PERL</a></li>
      <li><a href="JSON.html#PERL-%3E-JSON">PERL -&gt; JSON</a></li>
      <li><a href="JSON.html#OBJECT-SERIALISATION">OBJECT SERIALISATION</a>
        <ul>
          <li><a href="JSON.html#SERIALISATION">SERIALISATION</a></li>
          <li><a href="JSON.html#DESERIALISATION">DESERIALISATION</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li><a href="JSON.html#ENCODING/CODESET-FLAG-NOTES">ENCODING/CODESET FLAG NOTES</a></li>
  <li><a href="JSON.html#BACKWARD-INCOMPATIBILITY">BACKWARD INCOMPATIBILITY</a></li>
  <li><a href="JSON.html#BUGS">BUGS</a></li>
  <li><a href="JSON.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="JSON.html#AUTHOR">AUTHOR</a></li>
  <li><a href="JSON.html#CURRENT-MAINTAINER">CURRENT MAINTAINER</a></li>
  <li><a href="JSON.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>JSON - JSON (JavaScript Object Notation) encoder/decoder</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code> use JSON; # imports encode_json, decode_json, to_json and from_json.
 
 # simple and fast interfaces (expect/generate UTF-8)
 
 $utf8_encoded_json_text = encode_json $perl_hash_or_arrayref;
 $perl_hash_or_arrayref  = decode_json $utf8_encoded_json_text;
 
 # OO-interface
 
 $json = JSON-&gt;new-&gt;allow_nonref;
 
 $json_text   = $json-&gt;encode( $perl_scalar );
 $perl_scalar = $json-&gt;decode( $json_text );
 
 $pretty_printed = $json-&gt;pretty-&gt;encode( $perl_scalar ); # pretty-printing</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module is a thin wrapper for <a href="./JSON::XS.html">JSON::XS</a>-compatible modules with a few additional features. All the backend modules convert a Perl data structure to a JSON text and vice versa. This module uses <a href="./JSON::XS.html">JSON::XS</a> by default, and when JSON::XS is not available, falls back on <a href="https://metacpan.org/pod/JSON::PP">JSON::PP</a>, which is in the Perl core since 5.14. If JSON::PP is not available either, this module then falls back on JSON::backportPP (which is actually JSON::PP in a different .pm file) bundled in the same distribution as this module. You can also explicitly specify to use <a href="./Cpanel::JSON::XS.html">Cpanel::JSON::XS</a>, a fork of JSON::XS by Reini Urban.</p>

<p>All these backend modules have slight incompatibilities between them, including extra features that other modules don&#39;t support, but as long as you use only common features (most important ones are described below), migration from backend to backend should be reasonably easy. For details, see each backend module you use.</p>

<h1 id="CHOOSING-BACKEND"><a id="CHOOSING"></a>CHOOSING BACKEND</h1>

<p>This module respects an environmental variable called <code>PERL_JSON_BACKEND</code> when it decides a backend module to use. If this environmental variable is not set, it tries to load JSON::XS, and if JSON::XS is not available, it falls back on JSON::PP, and then JSON::backportPP if JSON::PP is not available either.</p>

<p>If you always don&#39;t want it to fall back on pure perl modules, set the variable like this (<code>export</code> may be <code>setenv</code>, <code>set</code> and the likes, depending on your environment):</p>

<pre><code>  &gt; export PERL_JSON_BACKEND=JSON::XS</code></pre>

<p>If you prefer Cpanel::JSON::XS to JSON::XS, then:</p>

<pre><code>  &gt; export PERL_JSON_BACKEND=Cpanel::JSON::XS,JSON::XS,JSON::PP</code></pre>

<p>You may also want to set this variable at the top of your test files, in order not to be bothered with incompatibilities between backends (you need to wrap this in <code>BEGIN</code>, and set before actually <code>use</code>-ing JSON module, as it decides its backend as soon as it&#39;s loaded):</p>

<pre><code>  BEGIN { $ENV{PERL_JSON_BACKEND}=&#39;JSON::backportPP&#39;; }
  use JSON;</code></pre>

<h1 id="USING-OPTIONAL-FEATURES"><a id="USING"></a>USING OPTIONAL FEATURES</h1>

<p>There are a few options you can set when you <code>use</code> this module. These historical options are only kept for backward compatibility, and should not be used in a new application.</p>

<dl>

<dt id="-support_by_pp"><a id="support_by_pp"></a>-support_by_pp</dt>
<dd>

<pre><code>   BEGIN { $ENV{PERL_JSON_BACKEND} = &#39;JSON::XS&#39; }
   
   use JSON -support_by_pp;
   
   my $json = JSON-&gt;new;
   # escape_slash is for JSON::PP only.
   $json-&gt;allow_nonref-&gt;escape_slash-&gt;encode(&quot;/&quot;);</code></pre>

<p>With this option, this module loads its pure perl backend along with its XS backend (if available), and lets the XS backend to watch if you set a flag only JSON::PP supports. When you do, the internal JSON::XS object is replaced with a newly created JSON::PP object with the setting copied from the XS object, so that you can use JSON::PP flags (and its slower <code>decode</code>/<code>encode</code> methods) from then on. In other words, this is not something that allows you to hook JSON::XS to change its behavior while keeping its speed. JSON::XS and JSON::PP objects are quite different (JSON::XS object is a blessed scalar reference, while JSON::PP object is a blessed hash reference), and can&#39;t share their internals.</p>

<p>To avoid needless overhead (by copying settings), you are advised not to use this option and just to use JSON::PP explicitly when you need JSON::PP features.</p>

</dd>
<dt id="-convert_blessed_universally"><a id="convert_blessed_universally"></a>-convert_blessed_universally</dt>
<dd>

<pre><code>   use JSON -convert_blessed_universally;

   my $json = JSON-&gt;new-&gt;allow_nonref-&gt;convert_blessed;
   my $object = bless {foo =&gt; &#39;bar&#39;}, &#39;Foo&#39;;
   $json-&gt;encode($object); # =&gt; {&quot;foo&quot;:&quot;bar&quot;}</code></pre>

<p>JSON::XS-compatible backend modules don&#39;t encode blessed objects by default (except for their boolean values, which are typically blessed JSON::PP::Boolean objects). If you need to encode a data structure that may contain objects, you usually need to look into the structure and replace objects with alternative non-blessed values, or enable <code>convert_blessed</code> and provide a <code>TO_JSON</code> method for each object&#39;s (base) class that may be found in the structure, in order to let the methods replace the objects with whatever scalar values the methods return.</p>

<p>If you need to serialise data structures that may contain arbitrary objects, it&#39;s probably better to use other serialisers (such as <a href="Sereal.html">Sereal</a> or <a href="https://metacpan.org/pod/Storable">Storable</a> for example), but if you do want to use this module for that purpose, <code>-convert_blessed_universally</code> option may help, which tweaks <code>encode</code> method of the backend to install <code>UNIVERSAL::TO_JSON</code> method (locally) before encoding, so that all the objects that don&#39;t have their own <code>TO_JSON</code> method can fall back on the method in the <code>UNIVERSAL</code> namespace. Note that you still need to enable <code>convert_blessed</code> flag to actually encode objects in a data structure, and <code>UNIVERSAL::TO_JSON</code> method installed by this option only converts blessed hash/array references into their unblessed clone (including private keys/values that are not supposed to be exposed). Other blessed references will be converted into null.</p>

<p>This feature is experimental and may be removed in the future.</p>

</dd>
<dt id="-no_export"><a id="no_export"></a>-no_export</dt>
<dd>

<p>When you don&#39;t want to import functional interfaces from a module, you usually supply <code>()</code> to its <code>use</code> statement.</p>

<pre><code>    use JSON (); # no functional interfaces</code></pre>

<p>If you don&#39;t want to import functional interfaces, but you also want to use any of the above options, add <code>-no_export</code> to the option list.</p>

<pre><code>   # no functional interfaces, while JSON::PP support is enabled.
   use JSON -support_by_pp, -no_export;</code></pre>

</dd>
</dl>

<h1 id="FUNCTIONAL-INTERFACE"><a id="FUNCTIONAL"></a>FUNCTIONAL INTERFACE</h1>

<p>This section is taken from JSON::XS. <code>encode_json</code> and <code>decode_json</code> are exported by default.</p>

<p>This module also exports <code>to_json</code> and <code>from_json</code> for backward compatibility. These are slower, and may expect/generate different stuff from what <code>encode_json</code> and <code>decode_json</code> do, depending on their options. It&#39;s better just to use Object-Oriented interfaces than using these two functions.</p>

<h2 id="encode_json">encode_json</h2>

<pre><code>    $json_text = encode_json $perl_scalar</code></pre>

<p>Converts the given Perl data structure to a UTF-8 encoded, binary string (that is, the string contains octets only). Croaks on error.</p>

<p>This function call is functionally identical to:</p>

<pre><code>    $json_text = JSON-&gt;new-&gt;utf8-&gt;encode($perl_scalar)</code></pre>

<p>Except being faster.</p>

<h2 id="decode_json">decode_json</h2>

<pre><code>    $perl_scalar = decode_json $json_text</code></pre>

<p>The opposite of <code>encode_json</code>: expects an UTF-8 (binary) string and tries to parse that as an UTF-8 encoded JSON text, returning the resulting reference. Croaks on error.</p>

<p>This function call is functionally identical to:</p>

<pre><code>    $perl_scalar = JSON-&gt;new-&gt;utf8-&gt;decode($json_text)</code></pre>

<p>Except being faster.</p>

<h2 id="to_json">to_json</h2>

<pre><code>   $json_text = to_json($perl_scalar[, $optional_hashref])</code></pre>

<p>Converts the given Perl data structure to a Unicode string by default. Croaks on error.</p>

<p>Basically, this function call is functionally identical to:</p>

<pre><code>   $json_text = JSON-&gt;new-&gt;encode($perl_scalar)</code></pre>

<p>Except being slower.</p>

<p>You can pass an optional hash reference to modify its behavior, but that may change what <code>to_json</code> expects/generates (see <code>ENCODING/CODESET FLAG NOTES</code> for details).</p>

<pre><code>   $json_text = to_json($perl_scalar, {utf8 =&gt; 1, pretty =&gt; 1})
   # =&gt; JSON-&gt;new-&gt;utf8(1)-&gt;pretty(1)-&gt;encode($perl_scalar)</code></pre>

<h2 id="from_json">from_json</h2>

<pre><code>   $perl_scalar = from_json($json_text[, $optional_hashref])</code></pre>

<p>The opposite of <code>to_json</code>: expects a Unicode string and tries to parse it, returning the resulting reference. Croaks on error.</p>

<p>Basically, this function call is functionally identical to:</p>

<pre><code>    $perl_scalar = JSON-&gt;new-&gt;decode($json_text)</code></pre>

<p>You can pass an optional hash reference to modify its behavior, but that may change what <code>from_json</code> expects/generates (see <code>ENCODING/CODESET FLAG NOTES</code> for details).</p>

<pre><code>    $perl_scalar = from_json($json_text, {utf8 =&gt; 1})
    # =&gt; JSON-&gt;new-&gt;utf8(1)-&gt;decode($json_text)</code></pre>

<h2 id="JSON::is_bool"><a id="JSON"></a>JSON::is_bool</h2>

<pre><code>    $is_boolean = JSON::is_bool($scalar)</code></pre>

<p>Returns true if the passed scalar represents either JSON::true or JSON::false, two constants that act like <code>1</code> and <code>0</code> respectively and are also used to represent JSON <code>true</code> and <code>false</code> in Perl strings.</p>

<p>See <a href="https://metacpan.org/pod/MAPPING">MAPPING</a>, below, for more information on how JSON values are mapped to Perl.</p>

<h1 id="COMMON-OBJECT-ORIENTED-INTERFACE"><a id="COMMON"></a>COMMON OBJECT-ORIENTED INTERFACE</h1>

<p>This section is also taken from JSON::XS.</p>

<p>The object oriented interface lets you configure your own encoding or decoding style, within the limits of supported formats.</p>

<h2 id="new">new</h2>

<pre><code>    $json = JSON-&gt;new</code></pre>

<p>Creates a new JSON::XS-compatible backend object that can be used to de/encode JSON strings. All boolean flags described below are by default <i>disabled</i> (with the exception of <code>allow_nonref</code>, which defaults to <i>enabled</i> since version <code>4.0</code>).</p>

<p>The mutators for flags all return the backend object again and thus calls can be chained:</p>

<pre><code>   my $json = JSON-&gt;new-&gt;utf8-&gt;space_after-&gt;encode({a =&gt; [1,2]})
   =&gt; {&quot;a&quot;: [1, 2]}</code></pre>

<h2 id="ascii">ascii</h2>

<pre><code>    $json = $json-&gt;ascii([$enable])
    
    $enabled = $json-&gt;get_ascii</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will not generate characters outside the code range <code>0..127</code> (which is ASCII). Any Unicode characters outside that range will be escaped using either a single \uXXXX (BMP characters) or a double \uHHHH\uLLLLL escape sequence, as per RFC4627. The resulting encoded JSON text can be treated as a native Unicode string, an ascii-encoded, latin1-encoded or UTF-8 encoded string, or any other superset of ASCII.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will not escape Unicode characters unless required by the JSON syntax or other flags. This results in a faster and more compact format.</p>

<p>See also the section <i>ENCODING/CODESET FLAG NOTES</i> later in this document.</p>

<p>The main use for this flag is to produce JSON texts that can be transmitted over a 7-bit channel, as the encoded JSON texts will not contain any 8 bit characters.</p>

<pre><code>  JSON-&gt;new-&gt;ascii(1)-&gt;encode([chr 0x10401])
  =&gt; [&quot;\ud801\udc01&quot;]</code></pre>

<h2 id="latin1">latin1</h2>

<pre><code>    $json = $json-&gt;latin1([$enable])
    
    $enabled = $json-&gt;get_latin1</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will encode the resulting JSON text as latin1 (or iso-8859-1), escaping any characters outside the code range <code>0..255</code>. The resulting string can be treated as a latin1-encoded JSON text or a native Unicode string. The <code>decode</code> method will not be affected in any way by this flag, as <code>decode</code> by default expects Unicode, which is a strict superset of latin1.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will not escape Unicode characters unless required by the JSON syntax or other flags.</p>

<p>See also the section <i>ENCODING/CODESET FLAG NOTES</i> later in this document.</p>

<p>The main use for this flag is efficiently encoding binary data as JSON text, as most octets will not be escaped, resulting in a smaller encoded size. The disadvantage is that the resulting JSON text is encoded in latin1 (and must correctly be treated as such when storing and transferring), a rare encoding for JSON. It is therefore most useful when you want to store data structures known to contain binary data efficiently in files or databases, not when talking to other JSON encoders/decoders.</p>

<pre><code>  JSON-&gt;new-&gt;latin1-&gt;encode ([&quot;\x{89}\x{abc}&quot;]
  =&gt; [&quot;\x{89}\\u0abc&quot;]    # (perl syntax, U+abc escaped, U+89 not)</code></pre>

<h2 id="utf8">utf8</h2>

<pre><code>    $json = $json-&gt;utf8([$enable])
    
    $enabled = $json-&gt;get_utf8</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will encode the JSON result into UTF-8, as required by many protocols, while the <code>decode</code> method expects to be handled an UTF-8-encoded string. Please note that UTF-8-encoded strings do not contain any characters outside the range <code>0..255</code>, they are thus useful for bytewise/binary I/O. In future versions, enabling this option might enable autodetection of the UTF-16 and UTF-32 encoding families, as described in RFC4627.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will return the JSON string as a (non-encoded) Unicode string, while <code>decode</code> expects thus a Unicode string. Any decoding or encoding (e.g. to UTF-8 or UTF-16) needs to be done yourself, e.g. using the Encode module.</p>

<p>See also the section <i>ENCODING/CODESET FLAG NOTES</i> later in this document.</p>

<p>Example, output UTF-16BE-encoded JSON:</p>

<pre><code>  use Encode;
  $jsontext = encode &quot;UTF-16BE&quot;, JSON-&gt;new-&gt;encode ($object);</code></pre>

<p>Example, decode UTF-32LE-encoded JSON:</p>

<pre><code>  use Encode;
  $object = JSON-&gt;new-&gt;decode (decode &quot;UTF-32LE&quot;, $jsontext);</code></pre>

<h2 id="pretty">pretty</h2>

<pre><code>    $json = $json-&gt;pretty([$enable])</code></pre>

<p>This enables (or disables) all of the <code>indent</code>, <code>space_before</code> and <code>space_after</code> (and in the future possibly more) flags in one call to generate the most readable (or most compact) form possible.</p>

<h2 id="indent">indent</h2>

<pre><code>    $json = $json-&gt;indent([$enable])
    
    $enabled = $json-&gt;get_indent</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will use a multiline format as output, putting every array member or object/hash key-value pair into its own line, indenting them properly.</p>

<p>If <code>$enable</code> is false, no newlines or indenting will be produced, and the resulting JSON text is guaranteed not to contain any <code>newlines</code>.</p>

<p>This setting has no effect when decoding JSON texts.</p>

<h2 id="space_before">space_before</h2>

<pre><code>    $json = $json-&gt;space_before([$enable])
    
    $enabled = $json-&gt;get_space_before</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will add an extra optional space before the <code>:</code> separating keys from values in JSON objects.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will not add any extra space at those places.</p>

<p>This setting has no effect when decoding JSON texts. You will also most likely combine this setting with <code>space_after</code>.</p>

<p>Example, space_before enabled, space_after and indent disabled:</p>

<pre><code>   {&quot;key&quot; :&quot;value&quot;}</code></pre>

<h2 id="space_after">space_after</h2>

<pre><code>    $json = $json-&gt;space_after([$enable])
    
    $enabled = $json-&gt;get_space_after</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will add an extra optional space after the <code>:</code> separating keys from values in JSON objects and extra whitespace after the <code>,</code> separating key-value pairs and array members.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will not add any extra space at those places.</p>

<p>This setting has no effect when decoding JSON texts.</p>

<p>Example, space_before and indent disabled, space_after enabled:</p>

<pre><code>   {&quot;key&quot;: &quot;value&quot;}</code></pre>

<h2 id="relaxed">relaxed</h2>

<pre><code>    $json = $json-&gt;relaxed([$enable])
    
    $enabled = $json-&gt;get_relaxed</code></pre>

<p>If <code>$enable</code> is true (or missing), then <code>decode</code> will accept some extensions to normal JSON syntax (see below). <code>encode</code> will not be affected in any way. <i>Be aware that this option makes you accept invalid JSON texts as if they were valid!</i>. I suggest only to use this option to parse application-specific files written by humans (configuration files, resource files etc.)</p>

<p>If <code>$enable</code> is false (the default), then <code>decode</code> will only accept valid JSON texts.</p>

<p>Currently accepted extensions are:</p>

<ul>

<li><p>list items can have an end-comma</p>

<p>JSON <i>separates</i> array elements and key-value pairs with commas. This can be annoying if you write JSON texts manually and want to be able to quickly append elements, so this extension accepts comma at the end of such items not just between them:</p>

<pre><code>   [
      1,
      2, &lt;- this comma not normally allowed
   ]
   {
      &quot;k1&quot;: &quot;v1&quot;,
      &quot;k2&quot;: &quot;v2&quot;, &lt;- this comma not normally allowed
   }</code></pre>

</li>
<li><p>shell-style &#39;#&#39;-comments</p>

<p>Whenever JSON allows whitespace, shell-style comments are additionally allowed. They are terminated by the first carriage-return or line-feed character, after which more white-space and comments are allowed.</p>

<pre><code>  [
     1, # this comment not allowed in JSON
        # neither this one...
  ]</code></pre>

</li>
</ul>

<h2 id="canonical">canonical</h2>

<pre><code>    $json = $json-&gt;canonical([$enable])
    
    $enabled = $json-&gt;get_canonical</code></pre>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will output JSON objects by sorting their keys. This is adding a comparatively high overhead.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will output key-value pairs in the order Perl stores them (which will likely change between runs of the same script, and can change even within the same run from 5.18 onwards).</p>

<p>This option is useful if you want the same data structure to be encoded as the same JSON text (given the same overall settings). If it is disabled, the same hash might be encoded differently even if contains the same data, as key-value pairs have no inherent ordering in Perl.</p>

<p>This setting has no effect when decoding JSON texts.</p>

<p>This setting has currently no effect on tied hashes.</p>

<h2 id="allow_nonref">allow_nonref</h2>

<pre><code>    $json = $json-&gt;allow_nonref([$enable])
    
    $enabled = $json-&gt;get_allow_nonref</code></pre>

<p>Unlike other boolean options, this option is enabled by default beginning with version <code>4.0</code>.</p>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method can convert a non-reference into its corresponding string, number or null JSON value, which is an extension to RFC4627. Likewise, <code>decode</code> will accept those JSON values instead of croaking.</p>

<p>If <code>$enable</code> is false, then the <code>encode</code> method will croak if it isn&#39;t passed an arrayref or hashref, as JSON texts must either be an object or array. Likewise, <code>decode</code> will croak if given something that is not a JSON object or array.</p>

<p>Example, encode a Perl scalar as JSON value with enabled <code>allow_nonref</code>, resulting in an invalid JSON text:</p>

<pre><code>   JSON-&gt;new-&gt;allow_nonref-&gt;encode (&quot;Hello, World!&quot;)
   =&gt; &quot;Hello, World!&quot;</code></pre>

<h2 id="allow_unknown">allow_unknown</h2>

<pre><code>    $json = $json-&gt;allow_unknown ([$enable])
    
    $enabled = $json-&gt;get_allow_unknown</code></pre>

<p>If <code>$enable</code> is true (or missing), then <code>encode</code> will <i>not</i> throw an exception when it encounters values it cannot represent in JSON (for example, filehandles) but instead will encode a JSON <code>null</code> value. Note that blessed objects are not included here and are handled separately by c&lt;allow_blessed&gt;.</p>

<p>If <code>$enable</code> is false (the default), then <code>encode</code> will throw an exception when it encounters anything it cannot encode as JSON.</p>

<p>This option does not affect <code>decode</code> in any way, and it is recommended to leave it off unless you know your communications partner.</p>

<h2 id="allow_blessed">allow_blessed</h2>

<pre><code>    $json = $json-&gt;allow_blessed([$enable])
    
    $enabled = $json-&gt;get_allow_blessed</code></pre>

<p>See <a href="JSON.html#OBJECT-SERIALISATION">&quot;OBJECT SERIALISATION&quot;</a> for details.</p>

<p>If <code>$enable</code> is true (or missing), then the <code>encode</code> method will not barf when it encounters a blessed reference that it cannot convert otherwise. Instead, a JSON <code>null</code> value is encoded instead of the object.</p>

<p>If <code>$enable</code> is false (the default), then <code>encode</code> will throw an exception when it encounters a blessed object that it cannot convert otherwise.</p>

<p>This setting has no effect on <code>decode</code>.</p>

<h2 id="convert_blessed">convert_blessed</h2>

<pre><code>    $json = $json-&gt;convert_blessed([$enable])
    
    $enabled = $json-&gt;get_convert_blessed</code></pre>

<p>See <a href="JSON.html#OBJECT-SERIALISATION">&quot;OBJECT SERIALISATION&quot;</a> for details.</p>

<p>If <code>$enable</code> is true (or missing), then <code>encode</code>, upon encountering a blessed object, will check for the availability of the <code>TO_JSON</code> method on the object&#39;s class. If found, it will be called in scalar context and the resulting scalar will be encoded instead of the object.</p>

<p>The <code>TO_JSON</code> method may safely call die if it wants. If <code>TO_JSON</code> returns other blessed objects, those will be handled in the same way. <code>TO_JSON</code> must take care of not causing an endless recursion cycle (== crash) in this case. The name of <code>TO_JSON</code> was chosen because other methods called by the Perl core (== not by the user of the object) are usually in upper case letters and to avoid collisions with any <code>to_json</code> function or method.</p>

<p>If <code>$enable</code> is false (the default), then <code>encode</code> will not consider this type of conversion.</p>

<p>This setting has no effect on <code>decode</code>.</p>

<h2 id="allow_tags-(since-version-3.0)"><a id="allow_tags"></a><a id="allow_tags--since-version-3.0"></a>allow_tags (since version 3.0)</h2>

<pre><code>    $json = $json-&gt;allow_tags([$enable])

    $enabled = $json-&gt;get_allow_tags</code></pre>

<p>See <a href="JSON.html#OBJECT-SERIALISATION">&quot;OBJECT SERIALISATION&quot;</a> for details.</p>

<p>If <code>$enable</code> is true (or missing), then <code>encode</code>, upon encountering a blessed object, will check for the availability of the <code>FREEZE</code> method on the object&#39;s class. If found, it will be used to serialise the object into a nonstandard tagged JSON value (that JSON decoders cannot decode).</p>

<p>It also causes <code>decode</code> to parse such tagged JSON values and deserialise them via a call to the <code>THAW</code> method.</p>

<p>If <code>$enable</code> is false (the default), then <code>encode</code> will not consider this type of conversion, and tagged JSON values will cause a parse error in <code>decode</code>, as if tags were not part of the grammar.</p>

<h2 id="boolean_values-(since-version-4.0)"><a id="boolean_values"></a><a id="boolean_values--since-version-4.0"></a>boolean_values (since version 4.0)</h2>

<pre><code>    $json-&gt;boolean_values([$false, $true])

    ($false,  $true) = $json-&gt;get_boolean_values</code></pre>

<p>By default, JSON booleans will be decoded as overloaded <code>$JSON::false</code> and <code>$JSON::true</code> objects.</p>

<p>With this method you can specify your own boolean values for decoding - on decode, JSON <code>false</code> will be decoded as a copy of <code>$false</code>, and JSON <code>true</code> will be decoded as <code>$true</code> (&quot;copy&quot; here is the same thing as assigning a value to another variable, i.e. <code>$copy = $false</code>).</p>

<p>This is useful when you want to pass a decoded data structure directly to other serialisers like YAML, Data::MessagePack and so on.</p>

<p>Note that this works only when you <code>decode</code>. You can set incompatible boolean objects (like <a href="boolean.html">boolean</a>), but when you <code>encode</code> a data structure with such boolean objects, you still need to enable <code>convert_blessed</code> (and add a <code>TO_JSON</code> method if necessary).</p>

<p>Calling this method without any arguments will reset the booleans to their default values.</p>

<p><code>get_boolean_values</code> will return both <code>$false</code> and <code>$true</code> values, or the empty list when they are set to the default.</p>

<h2 id="filter_json_object">filter_json_object</h2>

<pre><code>    $json = $json-&gt;filter_json_object([$coderef])</code></pre>

<p>When <code>$coderef</code> is specified, it will be called from <code>decode</code> each time it decodes a JSON object. The only argument is a reference to the newly-created hash. If the code references returns a single scalar (which need not be a reference), this value (or rather a copy of it) is inserted into the deserialised data structure. If it returns an empty list (NOTE: <i>not</i> <code>undef</code>, which is a valid scalar), the original deserialised hash will be inserted. This setting can slow down decoding considerably.</p>

<p>When <code>$coderef</code> is omitted or undefined, any existing callback will be removed and <code>decode</code> will not change the deserialised hash in any way.</p>

<p>Example, convert all JSON objects into the integer 5:</p>

<pre><code>   my $js = JSON-&gt;new-&gt;filter_json_object(sub { 5 });
   # returns [5]
   $js-&gt;decode(&#39;[{}]&#39;);
   # returns 5
   $js-&gt;decode(&#39;{&quot;a&quot;:1, &quot;b&quot;:2}&#39;);</code></pre>

<h2 id="filter_json_single_key_object">filter_json_single_key_object</h2>

<pre><code>    $json = $json-&gt;filter_json_single_key_object($key [=&gt; $coderef])</code></pre>

<p>Works remotely similar to <code>filter_json_object</code>, but is only called for JSON objects having a single key named <code>$key</code>.</p>

<p>This <code>$coderef</code> is called before the one specified via <code>filter_json_object</code>, if any. It gets passed the single value in the JSON object. If it returns a single value, it will be inserted into the data structure. If it returns nothing (not even <code>undef</code> but the empty list), the callback from <code>filter_json_object</code> will be called next, as if no single-key callback were specified.</p>

<p>If <code>$coderef</code> is omitted or undefined, the corresponding callback will be disabled. There can only ever be one callback for a given key.</p>

<p>As this callback gets called less often then the <code>filter_json_object</code> one, decoding speed will not usually suffer as much. Therefore, single-key objects make excellent targets to serialise Perl objects into, especially as single-key JSON objects are as close to the type-tagged value concept as JSON gets (it&#39;s basically an ID/VALUE tuple). Of course, JSON does not support this in any way, so you need to make sure your data never looks like a serialised Perl hash.</p>

<p>Typical names for the single object key are <code>__class_whatever__</code>, or <code>$__dollars_are_rarely_used__$</code> or <code>}ugly_brace_placement</code>, or even things like <code>__class_md5sum(classname)__</code>, to reduce the risk of clashing with real hashes.</p>

<p>Example, decode JSON objects of the form <code>{ &quot;__widget__&quot; =&gt; &lt;id&gt; }</code> into the corresponding <code>$WIDGET{&lt;id&gt;}</code> object:</p>

<pre><code>   # return whatever is in $WIDGET{5}:
   JSON
      -&gt;new
      -&gt;filter_json_single_key_object (__widget__ =&gt; sub {
            $WIDGET{ $_[0] }
         })
      -&gt;decode (&#39;{&quot;__widget__&quot;: 5&#39;)

   # this can be used with a TO_JSON method in some &quot;widget&quot; class
   # for serialisation to json:
   sub WidgetBase::TO_JSON {
      my ($self) = @_;

      unless ($self-&gt;{id}) {
         $self-&gt;{id} = ..get..some..id..;
         $WIDGET{$self-&gt;{id}} = $self;
      }

      { __widget__ =&gt; $self-&gt;{id} }
   }</code></pre>

<h2 id="max_depth">max_depth</h2>

<pre><code>    $json = $json-&gt;max_depth([$maximum_nesting_depth])
    
    $max_depth = $json-&gt;get_max_depth</code></pre>

<p>Sets the maximum nesting level (default <code>512</code>) accepted while encoding or decoding. If a higher nesting level is detected in JSON text or a Perl data structure, then the encoder and decoder will stop and croak at that point.</p>

<p>Nesting level is defined by number of hash- or arrayrefs that the encoder needs to traverse to reach a given point or the number of <code>{</code> or <code>[</code> characters without their matching closing parenthesis crossed to reach a given character in a string.</p>

<p>Setting the maximum depth to one disallows any nesting, so that ensures that the object is only a single hash/object or array.</p>

<p>If no argument is given, the highest possible setting will be used, which is rarely useful.</p>

<p>See <a href="./JSON::XS.html#SECURITY-CONSIDERATIONS">&quot;SECURITY CONSIDERATIONS&quot; in JSON::XS</a> for more info on why this is useful.</p>

<h2 id="max_size">max_size</h2>

<pre><code>    $json = $json-&gt;max_size([$maximum_string_size])
    
    $max_size = $json-&gt;get_max_size</code></pre>

<p>Set the maximum length a JSON text may have (in bytes) where decoding is being attempted. The default is <code>0</code>, meaning no limit. When <code>decode</code> is called on a string that is longer then this many bytes, it will not attempt to decode the string but throw an exception. This setting has no effect on <code>encode</code> (yet).</p>

<p>If no argument is given, the limit check will be deactivated (same as when <code>0</code> is specified).</p>

<p>See <a href="./JSON::XS.html#SECURITY-CONSIDERATIONS">&quot;SECURITY CONSIDERATIONS&quot; in JSON::XS</a> for more info on why this is useful.</p>

<h2 id="encode">encode</h2>

<pre><code>    $json_text = $json-&gt;encode($perl_scalar)</code></pre>

<p>Converts the given Perl value or data structure to its JSON representation. Croaks on error.</p>

<h2 id="decode">decode</h2>

<pre><code>    $perl_scalar = $json-&gt;decode($json_text)</code></pre>

<p>The opposite of <code>encode</code>: expects a JSON text and tries to parse it, returning the resulting simple scalar or reference. Croaks on error.</p>

<h2 id="decode_prefix">decode_prefix</h2>

<pre><code>    ($perl_scalar, $characters) = $json-&gt;decode_prefix($json_text)</code></pre>

<p>This works like the <code>decode</code> method, but instead of raising an exception when there is trailing garbage after the first JSON object, it will silently stop parsing there and return the number of characters consumed so far.</p>

<p>This is useful if your JSON texts are not delimited by an outer protocol and you need to know where the JSON text ends.</p>

<pre><code>   JSON-&gt;new-&gt;decode_prefix (&quot;[1] the tail&quot;)
   =&gt; ([1], 3)</code></pre>

<h1 id="ADDITIONAL-METHODS"><a id="ADDITIONAL"></a>ADDITIONAL METHODS</h1>

<p>The following methods are for this module only.</p>

<h2 id="backend">backend</h2>

<pre><code>    $backend = $json-&gt;backend</code></pre>

<p>Since 2.92, <code>backend</code> method returns an abstract backend module used currently, which should be JSON::Backend::XS (which inherits JSON::XS or Cpanel::JSON::XS), or JSON::Backend::PP (which inherits JSON::PP), not to monkey-patch the actual backend module globally.</p>

<p>If you need to know what is used actually, use <code>isa</code>, instead of string comparison.</p>

<h2 id="is_xs">is_xs</h2>

<pre><code>    $boolean = $json-&gt;is_xs</code></pre>

<p>Returns true if the backend inherits JSON::XS or Cpanel::JSON::XS.</p>

<h2 id="is_pp">is_pp</h2>

<pre><code>    $boolean = $json-&gt;is_pp</code></pre>

<p>Returns true if the backend inherits JSON::PP.</p>

<h2 id="property">property</h2>

<pre><code>    $settings = $json-&gt;property()</code></pre>

<p>Returns a reference to a hash that holds all the common flag settings.</p>

<pre><code>    $json = $json-&gt;property(&#39;utf8&#39; =&gt; 1)
    $value = $json-&gt;property(&#39;utf8&#39;) # 1</code></pre>

<p>You can use this to get/set a value of a particular flag.</p>

<h2 id="boolean">boolean</h2>

<pre><code>    $boolean_object = JSON-&gt;boolean($scalar)</code></pre>

<p>Returns $JSON::true if $scalar contains a true value, $JSON::false otherwise. You can use this as a full-qualified function (<code>JSON::boolean($scalar)</code>).</p>

<h1 id="INCREMENTAL-PARSING"><a id="INCREMENTAL"></a>INCREMENTAL PARSING</h1>

<p>This section is also taken from JSON::XS.</p>

<p>In some cases, there is the need for incremental parsing of JSON texts. While this module always has to keep both JSON text and resulting Perl data structure in memory at one time, it does allow you to parse a JSON stream incrementally. It does so by accumulating text until it has a full JSON object, which it then can decode. This process is similar to using <code>decode_prefix</code> to see if a full JSON object is available, but is much more efficient (and can be implemented with a minimum of method calls).</p>

<p>This module will only attempt to parse the JSON text once it is sure it has enough text to get a decisive result, using a very simple but truly incremental parser. This means that it sometimes won&#39;t stop as early as the full parser, for example, it doesn&#39;t detect mismatched parentheses. The only thing it guarantees is that it starts decoding as soon as a syntactically valid JSON text has been seen. This means you need to set resource limits (e.g. <code>max_size</code>) to ensure the parser will stop parsing in the presence if syntax errors.</p>

<p>The following methods implement this incremental parser.</p>

<h2 id="incr_parse">incr_parse</h2>

<pre><code>    $json-&gt;incr_parse( [$string] ) # void context
    
    $obj_or_undef = $json-&gt;incr_parse( [$string] ) # scalar context
    
    @obj_or_empty = $json-&gt;incr_parse( [$string] ) # list context</code></pre>

<p>This is the central parsing function. It can both append new text and extract objects from the stream accumulated so far (both of these functions are optional).</p>

<p>If <code>$string</code> is given, then this string is appended to the already existing JSON fragment stored in the <code>$json</code> object.</p>

<p>After that, if the function is called in void context, it will simply return without doing anything further. This can be used to add more text in as many chunks as you want.</p>

<p>If the method is called in scalar context, then it will try to extract exactly <i>one</i> JSON object. If that is successful, it will return this object, otherwise it will return <code>undef</code>. If there is a parse error, this method will croak just as <code>decode</code> would do (one can then use <code>incr_skip</code> to skip the erroneous part). This is the most common way of using the method.</p>

<p>And finally, in list context, it will try to extract as many objects from the stream as it can find and return them, or the empty list otherwise. For this to work, there must be no separators (other than whitespace) between the JSON objects or arrays, instead they must be concatenated back-to-back. If an error occurs, an exception will be raised as in the scalar context case. Note that in this case, any previously-parsed JSON texts will be lost.</p>

<p>Example: Parse some JSON arrays/objects in a given string and return them.</p>

<pre><code>    my @objs = JSON-&gt;new-&gt;incr_parse (&quot;[5][7][1,2]&quot;);</code></pre>

<h2 id="incr_text">incr_text</h2>

<pre><code>    $lvalue_string = $json-&gt;incr_text</code></pre>

<p>This method returns the currently stored JSON fragment as an lvalue, that is, you can manipulate it. This <i>only</i> works when a preceding call to <code>incr_parse</code> in <i>scalar context</i> successfully returned an object. Under all other circumstances you must not call this function (I mean it. although in simple tests it might actually work, it <i>will</i> fail under real world conditions). As a special exception, you can also call this method before having parsed anything.</p>

<p>That means you can only use this function to look at or manipulate text before or after complete JSON objects, not while the parser is in the middle of parsing a JSON object.</p>

<p>This function is useful in two cases: a) finding the trailing text after a JSON object or b) parsing multiple JSON objects separated by non-JSON text (such as commas).</p>

<h2 id="incr_skip">incr_skip</h2>

<pre><code>    $json-&gt;incr_skip</code></pre>

<p>This will reset the state of the incremental parser and will remove the parsed text from the input buffer so far. This is useful after <code>incr_parse</code> died, in which case the input buffer and incremental parser state is left unchanged, to skip the text parsed so far and to reset the parse state.</p>

<p>The difference to <code>incr_reset</code> is that only text until the parse error occurred is removed.</p>

<h2 id="incr_reset">incr_reset</h2>

<pre><code>    $json-&gt;incr_reset</code></pre>

<p>This completely resets the incremental parser, that is, after this call, it will be as if the parser had never parsed anything.</p>

<p>This is useful if you want to repeatedly parse JSON objects and want to ignore any trailing data, which means you have to reset the parser after each successful decode.</p>

<h1 id="MAPPING">MAPPING</h1>

<p>Most of this section is also taken from JSON::XS.</p>

<p>This section describes how the backend modules map Perl values to JSON values and vice versa. These mappings are designed to &quot;do the right thing&quot; in most circumstances automatically, preserving round-tripping characteristics (what you put in comes out as something equivalent).</p>

<p>For the more enlightened: note that in the following descriptions, lowercase <i>perl</i> refers to the Perl interpreter, while uppercase <i>Perl</i> refers to the abstract Perl language itself.</p>

<h2 id="JSON-&gt;-PERL"><a id="JSON1"></a><a id="JSON---PERL"></a>JSON -&gt; PERL</h2>

<dl>

<dt id="object">object</dt>
<dd>

<p>A JSON object becomes a reference to a hash in Perl. No ordering of object keys is preserved (JSON does not preserver object key ordering itself).</p>

</dd>
<dt id="array">array</dt>
<dd>

<p>A JSON array becomes a reference to an array in Perl.</p>

</dd>
<dt id="string">string</dt>
<dd>

<p>A JSON string becomes a string scalar in Perl - Unicode codepoints in JSON are represented by the same codepoints in the Perl string, so no manual decoding is necessary.</p>

</dd>
<dt id="number">number</dt>
<dd>

<p>A JSON number becomes either an integer, numeric (floating point) or string scalar in perl, depending on its range and any fractional parts. On the Perl level, there is no difference between those as Perl handles all the conversion details, but an integer may take slightly less memory and might represent more values exactly than floating point numbers.</p>

<p>If the number consists of digits only, this module will try to represent it as an integer value. If that fails, it will try to represent it as a numeric (floating point) value if that is possible without loss of precision. Otherwise it will preserve the number as a string value (in which case you lose roundtripping ability, as the JSON number will be re-encoded to a JSON string).</p>

<p>Numbers containing a fractional or exponential part will always be represented as numeric (floating point) values, possibly at a loss of precision (in which case you might lose perfect roundtripping ability, but the JSON number will still be re-encoded as a JSON number).</p>

<p>Note that precision is not accuracy - binary floating point values cannot represent most decimal fractions exactly, and when converting from and to floating point, this module only guarantees precision up to but not including the least significant bit.</p>

</dd>
<dt id="true,-false"><a id="true"></a><a id="true--false"></a>true, false</dt>
<dd>

<p>These JSON atoms become <code>JSON::true</code> and <code>JSON::false</code>, respectively. They are overloaded to act almost exactly like the numbers <code>1</code> and <code>0</code>. You can check whether a scalar is a JSON boolean by using the <code>JSON::is_bool</code> function.</p>

</dd>
<dt id="null">null</dt>
<dd>

<p>A JSON null atom becomes <code>undef</code> in Perl.</p>

</dd>
<dt id="shell-style-comments-(#-text)"><a id="shell"></a><a id="shell-style-comments---text"></a>shell-style comments (<code># <i>text</i></code>)</dt>
<dd>

<p>As a nonstandard extension to the JSON syntax that is enabled by the <code>relaxed</code> setting, shell-style comments are allowed. They can start anywhere outside strings and go till the end of the line.</p>

</dd>
<dt id="tagged-values-((tag)value)."><a id="tagged"></a><a id="tagged-values--tag-value"></a>tagged values (<code>(<i>tag</i>)<i>value</i></code>).</dt>
<dd>

<p>Another nonstandard extension to the JSON syntax, enabled with the <code>allow_tags</code> setting, are tagged values. In this implementation, the <i>tag</i> must be a perl package/class name encoded as a JSON string, and the <i>value</i> must be a JSON array encoding optional constructor arguments.</p>

<p>See <a href="JSON.html#OBJECT-SERIALISATION">&quot;OBJECT SERIALISATION&quot;</a>, below, for details.</p>

</dd>
</dl>

<h2 id="PERL-&gt;-JSON"><a id="PERL"></a><a id="PERL---JSON"></a>PERL -&gt; JSON</h2>

<p>The mapping from Perl to JSON is slightly more difficult, as Perl is a truly typeless language, so we can only guess which JSON type is meant by a Perl value.</p>

<dl>

<dt id="hash-references"><a id="hash"></a>hash references</dt>
<dd>

<p>Perl hash references become JSON objects. As there is no inherent ordering in hash keys (or JSON objects), they will usually be encoded in a pseudo-random order. This module can optionally sort the hash keys (determined by the <i>canonical</i> flag), so the same data structure will serialise to the same JSON text (given same settings and version of the same backend), but this incurs a runtime overhead and is only rarely useful, e.g. when you want to compare some JSON text against another for equality.</p>

</dd>
<dt id="array-references"><a id="array1"></a>array references</dt>
<dd>

<p>Perl array references become JSON arrays.</p>

</dd>
<dt id="other-references"><a id="other"></a>other references</dt>
<dd>

<p>Other unblessed references are generally not allowed and will cause an exception to be thrown, except for references to the integers <code>0</code> and <code>1</code>, which get turned into <code>false</code> and <code>true</code> atoms in JSON. You can also use <code>JSON::false</code> and <code>JSON::true</code> to improve readability.</p>

<pre><code>   encode_json [\0,JSON::true]      # yields [false,true]</code></pre>

</dd>
<dt id="JSON::true,-JSON::false,-JSON::null"><a id="JSON2"></a><a id="JSON::true--JSON::false--JSON::null"></a>JSON::true, JSON::false, JSON::null</dt>
<dd>

<p>These special values become JSON true and JSON false values, respectively. You can also use <code>\1</code> and <code>\0</code> directly if you want.</p>

</dd>
<dt id="blessed-objects"><a id="blessed"></a>blessed objects</dt>
<dd>

<p>Blessed objects are not directly representable in JSON, but <code>JSON::XS</code> allows various ways of handling objects. See <a href="JSON.html#OBJECT-SERIALISATION">&quot;OBJECT SERIALISATION&quot;</a>, below, for details.</p>

</dd>
<dt id="simple-scalars"><a id="simple"></a>simple scalars</dt>
<dd>

<p>Simple Perl scalars (any scalar that is not a reference) are the most difficult objects to encode: this module will encode undefined scalars as JSON <code>null</code> values, scalars that have last been used in a string context before encoding as JSON strings, and anything else as number value:</p>

<pre><code>   # dump as number
   encode_json [2]                      # yields [2]
   encode_json [-3.0e17]                # yields [-3e+17]
   my $value = 5; encode_json [$value]  # yields [5]

   # used as string, so dump as string
   print $value;
   encode_json [$value]                 # yields [&quot;5&quot;]

   # undef becomes null
   encode_json [undef]                  # yields [null]</code></pre>

<p>You can force the type to be a string by stringifying it:</p>

<pre><code>   my $x = 3.1; # some variable containing a number
   &quot;$x&quot;;        # stringified
   $x .= &quot;&quot;;    # another, more awkward way to stringify
   print $x;    # perl does it for you, too, quite often</code></pre>

<p>You can force the type to be a number by numifying it:</p>

<pre><code>   my $x = &quot;3&quot;; # some variable containing a string
   $x += 0;     # numify it, ensuring it will be dumped as a number
   $x *= 1;     # same thing, the choice is yours.</code></pre>

<p>You can not currently force the type in other, less obscure, ways. Tell me if you need this capability (but don&#39;t forget to explain why it&#39;s needed :).</p>

<p>Since version 2.91_01, JSON::PP uses a different number detection logic that converts a scalar that is possible to turn into a number safely. The new logic is slightly faster, and tends to help people who use older perl or who want to encode complicated data structure. However, this may results in a different JSON text from the one JSON::XS encodes (and thus may break tests that compare entire JSON texts). If you do need the previous behavior for better compatibility or for finer control, set PERL_JSON_PP_USE_B environmental variable to true before you <code>use</code> JSON.</p>

<p>Note that numerical precision has the same meaning as under Perl (so binary to decimal conversion follows the same rules as in Perl, which can differ to other languages). Also, your perl interpreter might expose extensions to the floating point numbers of your platform, such as infinities or NaN&#39;s - these cannot be represented in JSON, and it is an error to pass those in.</p>

<p>JSON.pm backend modules trust what you pass to <code>encode</code> method (or <code>encode_json</code> function) is a clean, validated data structure with values that can be represented as valid JSON values only, because it&#39;s not from an external data source (as opposed to JSON texts you pass to <code>decode</code> or <code>decode_json</code>, which JSON backends consider tainted and don&#39;t trust). As JSON backends don&#39;t know exactly what you and consumers of your JSON texts want the unexpected values to be (you may want to convert them into null, or to stringify them with or without normalisation (string representation of infinities/NaN may vary depending on platforms), or to croak without conversion), you&#39;re advised to do what you and your consumers need before you encode, and also not to numify values that may start with values that look like a number (including infinities/NaN), without validating.</p>

</dd>
</dl>

<h2 id="OBJECT-SERIALISATION"><a id="OBJECT"></a>OBJECT SERIALISATION</h2>

<p>As JSON cannot directly represent Perl objects, you have to choose between a pure JSON representation (without the ability to deserialise the object automatically again), and a nonstandard extension to the JSON syntax, tagged values.</p>

<h3 id="SERIALISATION">SERIALISATION</h3>

<p>What happens when this module encounters a Perl object depends on the <code>allow_blessed</code>, <code>convert_blessed</code> and <code>allow_tags</code> settings, which are used in this order:</p>

<dl>

<dt id="1.-allow_tags-is-enabled-and-the-object-has-a-FREEZE-method."><a id="1"></a><a id="allow_tags-is-enabled-and-the-object-has-a-FREEZE-method"></a>1. <code>allow_tags</code> is enabled and the object has a <code>FREEZE</code> method.</dt>
<dd>

<p>In this case, <code>JSON</code> creates a tagged JSON value, using a nonstandard extension to the JSON syntax.</p>

<p>This works by invoking the <code>FREEZE</code> method on the object, with the first argument being the object to serialise, and the second argument being the constant string <code>JSON</code> to distinguish it from other serialisers.</p>

<p>The <code>FREEZE</code> method can return any number of values (i.e. zero or more). These values and the package/classname of the object will then be encoded as a tagged JSON value in the following format:</p>

<pre><code>   (&quot;classname&quot;)[FREEZE return values...]</code></pre>

<p>e.g.:</p>

<pre><code>   (&quot;URI&quot;)[&quot;http://www.google.com/&quot;]
   (&quot;MyDate&quot;)[2013,10,29]
   (&quot;ImageData::JPEG&quot;)[&quot;Z3...VlCg==&quot;]</code></pre>

<p>For example, the hypothetical <code>My::Object</code> <code>FREEZE</code> method might use the objects <code>type</code> and <code>id</code> members to encode the object:</p>

<pre><code>   sub My::Object::FREEZE {
      my ($self, $serialiser) = @_;

      ($self-&gt;{type}, $self-&gt;{id})
   }</code></pre>

</dd>
<dt id="2.-convert_blessed-is-enabled-and-the-object-has-a-TO_JSON-method."><a id="2"></a><a id="convert_blessed-is-enabled-and-the-object-has-a-TO_JSON-method"></a>2. <code>convert_blessed</code> is enabled and the object has a <code>TO_JSON</code> method.</dt>
<dd>

<p>In this case, the <code>TO_JSON</code> method of the object is invoked in scalar context. It must return a single scalar that can be directly encoded into JSON. This scalar replaces the object in the JSON text.</p>

<p>For example, the following <code>TO_JSON</code> method will convert all <a href="URI.html">URI</a> objects to JSON strings when serialised. The fact that these values originally were <a href="URI.html">URI</a> objects is lost.</p>

<pre><code>   sub URI::TO_JSON {
      my ($uri) = @_;
      $uri-&gt;as_string
   }</code></pre>

</dd>
<dt id="3.-allow_blessed-is-enabled."><a id="3"></a><a id="allow_blessed-is-enabled"></a>3. <code>allow_blessed</code> is enabled.</dt>
<dd>

<p>The object will be serialised as a JSON null value.</p>

</dd>
<dt id="4.-none-of-the-above"><a id="4"></a><a id="none-of-the-above"></a>4. none of the above</dt>
<dd>

<p>If none of the settings are enabled or the respective methods are missing, this module throws an exception.</p>

</dd>
</dl>

<h3 id="DESERIALISATION">DESERIALISATION</h3>

<p>For deserialisation there are only two cases to consider: either nonstandard tagging was used, in which case <code>allow_tags</code> decides, or objects cannot be automatically be deserialised, in which case you can use postprocessing or the <code>filter_json_object</code> or <code>filter_json_single_key_object</code> callbacks to get some real objects our of your JSON.</p>

<p>This section only considers the tagged value case: a tagged JSON object is encountered during decoding and <code>allow_tags</code> is disabled, a parse error will result (as if tagged values were not part of the grammar).</p>

<p>If <code>allow_tags</code> is enabled, this module will look up the <code>THAW</code> method of the package/classname used during serialisation (it will not attempt to load the package as a Perl module). If there is no such method, the decoding will fail with an error.</p>

<p>Otherwise, the <code>THAW</code> method is invoked with the classname as first argument, the constant string <code>JSON</code> as second argument, and all the values from the JSON array (the values originally returned by the <code>FREEZE</code> method) as remaining arguments.</p>

<p>The method must then return the object. While technically you can return any Perl scalar, you might have to enable the <code>allow_nonref</code> setting to make that work in all cases, so better return an actual blessed reference.</p>

<p>As an example, let&#39;s implement a <code>THAW</code> function that regenerates the <code>My::Object</code> from the <code>FREEZE</code> example earlier:</p>

<pre><code>   sub My::Object::THAW {
      my ($class, $serialiser, $type, $id) = @_;

      $class-&gt;new (type =&gt; $type, id =&gt; $id)
   }</code></pre>

<h1 id="ENCODING/CODESET-FLAG-NOTES"><a id="ENCODING"></a><a id="ENCODING-CODESET-FLAG-NOTES"></a>ENCODING/CODESET FLAG NOTES</h1>

<p>This section is taken from JSON::XS.</p>

<p>The interested reader might have seen a number of flags that signify encodings or codesets - <code>utf8</code>, <code>latin1</code> and <code>ascii</code>. There seems to be some confusion on what these do, so here is a short comparison:</p>

<p><code>utf8</code> controls whether the JSON text created by <code>encode</code> (and expected by <code>decode</code>) is UTF-8 encoded or not, while <code>latin1</code> and <code>ascii</code> only control whether <code>encode</code> escapes character values outside their respective codeset range. Neither of these flags conflict with each other, although some combinations make less sense than others.</p>

<p>Care has been taken to make all flags symmetrical with respect to <code>encode</code> and <code>decode</code>, that is, texts encoded with any combination of these flag values will be correctly decoded when the same flags are used - in general, if you use different flag settings while encoding vs. when decoding you likely have a bug somewhere.</p>

<p>Below comes a verbose discussion of these flags. Note that a &quot;codeset&quot; is simply an abstract set of character-codepoint pairs, while an encoding takes those codepoint numbers and <i>encodes</i> them, in our case into octets. Unicode is (among other things) a codeset, UTF-8 is an encoding, and ISO-8859-1 (= latin 1) and ASCII are both codesets <i>and</i> encodings at the same time, which can be confusing.</p>

<dl>

<dt id="utf8-flag-disabled"><a id="utf81"></a><code>utf8</code> flag disabled</dt>
<dd>

<p>When <code>utf8</code> is disabled (the default), then <code>encode</code>/<code>decode</code> generate and expect Unicode strings, that is, characters with high ordinal Unicode values (&gt; 255) will be encoded as such characters, and likewise such characters are decoded as-is, no changes to them will be done, except &quot;(re-)interpreting&quot; them as Unicode codepoints or Unicode characters, respectively (to Perl, these are the same thing in strings unless you do funny/weird/dumb stuff).</p>

<p>This is useful when you want to do the encoding yourself (e.g. when you want to have UTF-16 encoded JSON texts) or when some other layer does the encoding for you (for example, when printing to a terminal using a filehandle that transparently encodes to UTF-8 you certainly do NOT want to UTF-8 encode your data first and have Perl encode it another time).</p>

</dd>
<dt id="utf8-flag-enabled"><a id="utf82"></a><code>utf8</code> flag enabled</dt>
<dd>

<p>If the <code>utf8</code>-flag is enabled, <code>encode</code>/<code>decode</code> will encode all characters using the corresponding UTF-8 multi-byte sequence, and will expect your input strings to be encoded as UTF-8, that is, no &quot;character&quot; of the input string must have any value &gt; 255, as UTF-8 does not allow that.</p>

<p>The <code>utf8</code> flag therefore switches between two modes: disabled means you will get a Unicode string in Perl, enabled means you get an UTF-8 encoded octet/binary string in Perl.</p>

</dd>
<dt id="latin1-or-ascii-flags-enabled"><a id="latin11"></a><code>latin1</code> or <code>ascii</code> flags enabled</dt>
<dd>

<p>With <code>latin1</code> (or <code>ascii</code>) enabled, <code>encode</code> will escape characters with ordinal values &gt; 255 (&gt; 127 with <code>ascii</code>) and encode the remaining characters as specified by the <code>utf8</code> flag.</p>

<p>If <code>utf8</code> is disabled, then the result is also correctly encoded in those character sets (as both are proper subsets of Unicode, meaning that a Unicode string with all character values &lt; 256 is the same thing as a ISO-8859-1 string, and a Unicode string with all character values &lt; 128 is the same thing as an ASCII string in Perl).</p>

<p>If <code>utf8</code> is enabled, you still get a correct UTF-8-encoded string, regardless of these flags, just some more characters will be escaped using <code>\uXXXX</code> then before.</p>

<p>Note that ISO-8859-1-<i>encoded</i> strings are not compatible with UTF-8 encoding, while ASCII-encoded strings are. That is because the ISO-8859-1 encoding is NOT a subset of UTF-8 (despite the ISO-8859-1 <i>codeset</i> being a subset of Unicode), while ASCII is.</p>

<p>Surprisingly, <code>decode</code> will ignore these flags and so treat all input values as governed by the <code>utf8</code> flag. If it is disabled, this allows you to decode ISO-8859-1- and ASCII-encoded strings, as both strict subsets of Unicode. If it is enabled, you can correctly decode UTF-8 encoded strings.</p>

<p>So neither <code>latin1</code> nor <code>ascii</code> are incompatible with the <code>utf8</code> flag - they only govern when the JSON output engine escapes a character or not.</p>

<p>The main use for <code>latin1</code> is to relatively efficiently store binary data as JSON, at the expense of breaking compatibility with most JSON decoders.</p>

<p>The main use for <code>ascii</code> is to force the output to not contain characters with values &gt; 127, which means you can interpret the resulting string as UTF-8, ISO-8859-1, ASCII, KOI8-R or most about any character set and 8-bit-encoding, and still get the same data structure back. This is useful when your channel for JSON transfer is not 8-bit clean or the encoding might be mangled in between (e.g. in mail), and works because ASCII is a proper subset of most 8-bit and multibyte encodings in use in the world.</p>

</dd>
</dl>

<h1 id="BACKWARD-INCOMPATIBILITY"><a id="BACKWARD"></a>BACKWARD INCOMPATIBILITY</h1>

<p>Since version 2.90, stringification (and string comparison) for <code>JSON::true</code> and <code>JSON::false</code> has not been overloaded. It shouldn&#39;t matter as long as you treat them as boolean values, but a code that expects they are stringified as &quot;true&quot; or &quot;false&quot; doesn&#39;t work as you have expected any more.</p>

<pre><code>    if (JSON::true eq &#39;true&#39;) {  # now fails

    print &quot;The result is $JSON::true now.&quot;; # =&gt; The result is 1 now.</code></pre>

<p>And now these boolean values don&#39;t inherit JSON::Boolean, either. When you need to test a value is a JSON boolean value or not, use <code>JSON::is_bool</code> function, instead of testing the value inherits a particular boolean class or not.</p>

<h1 id="BUGS">BUGS</h1>

<p>Please report bugs on backend selection and additional features this module provides to RT or GitHub issues for this module:</p>

<p><a href="https://rt.cpan.org/Public/Dist/Display.html?Queue=JSON">https://rt.cpan.org/Public/Dist/Display.html?Queue=JSON</a></p>

<p><a href="https://github.com/makamaka/JSON/issues">https://github.com/makamaka/JSON/issues</a></p>

<p>As for bugs on a specific behavior, please report to the author of the backend module you are using.</p>

<p>As for new features and requests to change common behaviors, please ask the author of JSON::XS (Marc Lehmann, &lt;schmorp[at]schmorp.de&gt;) first, by email (important!), to keep compatibility among JSON.pm backends.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="./JSON::XS.html">JSON::XS</a>, <a href="./Cpanel::JSON::XS.html">Cpanel::JSON::XS</a>, <a href="https://metacpan.org/pod/JSON::PP">JSON::PP</a> for backends.</p>

<p><a href="./JSON::MaybeXS.html">JSON::MaybeXS</a>, an alternative that prefers Cpanel::JSON::XS.</p>

<p><code>RFC4627</code>(<a href="http://www.ietf.org/rfc/rfc4627.txt">http://www.ietf.org/rfc/rfc4627.txt</a>)</p>

<p>RFC7159 (<a href="http://www.ietf.org/rfc/rfc7159.txt">http://www.ietf.org/rfc/rfc7159.txt</a>)</p>

<p>RFC8259 (<a href="http://www.ietf.org/rfc/rfc8259.txt">http://www.ietf.org/rfc/rfc8259.txt</a>)</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Makamaka Hannyaharamitu, &lt;makamaka[at]cpan.org&gt;</p>

<p>JSON::XS was written by Marc Lehmann &lt;schmorp[at]schmorp.de&gt;</p>

<p>The release of this new version owes to the courtesy of Marc Lehmann.</p>

<h1 id="CURRENT-MAINTAINER"><a id="CURRENT"></a>CURRENT MAINTAINER</h1>

<p>Kenichi Ishigaki, &lt;ishigaki[at]cpan.org&gt;</p>

<h1 id="COPYRIGHT-AND-LICENSE"><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>Copyright 2005-2013 by Makamaka Hannyaharamitu</p>

<p>Most of the documentation is taken from JSON::XS by Marc Lehmann</p>

<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install JSON, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm JSON</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install JSON</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="JSON.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
